#pragma once

#include "Stdafx.h"
#include "IfsAnimator.h"
#include "PresetMn.h"

using namespace System;

namespace OrionFlamesMn
{
	public ref class IfsAnimatorMn
	{
	public:
		IfsAnimatorMn()
		{
			m_IfsAnimator = new IfsAnimator();
			//m_IfsAnimator->NextPreset(0, false);
			//m_TestxForm = new xForm();
		}

		~IfsAnimatorMn()
		{
			Delete(m_IfsAnimator);//Make sure this works.
			//Delete(m_TestxForm);
		}

		void Draw(int width, int height)
		{
			m_IfsAnimator->Draw(width, height);
		}

		void NextPreset(unsigned int presetIndex, bool merge) { m_IfsAnimator->NextPreset(presetIndex, merge); }
		
		int CurrentPresetIndex() { return m_IfsAnimator->CurrentPresetIndex(); }
		PresetMn^ CurrentPreset() { return gcnew PresetMn(m_IfsAnimator->CurrentPreset()); }
		//PresetListMn PresetList() { return m_IfsAnimator->GetPresetList(); )
		//int PresetListSize() { return m_IfsAnimator->PresetListSize(); }
		//String^ PresetName(int i)
		void XformRotationMult(unsigned int index, float mult) { m_IfsAnimator->XformRotationMult(index, mult); }
		float XformRotationMult(unsigned int index) { return m_IfsAnimator->XformRotationMult(index); }

		property bool VaryColor
		{
			bool get() { return m_IfsAnimator->VaryColor(); }
			void set(bool vary) { m_IfsAnimator->VaryColor(vary); }
		}

		property bool VaryExposure
		{
			bool get() { return m_IfsAnimator->VaryExposure(); }
			void set(bool vary) { m_IfsAnimator->VaryExposure(vary); }
		}

		property bool RotateX
		{
			bool get() { return m_IfsAnimator->RotateX(); }
			void set(bool rotate) { m_IfsAnimator->RotateX(rotate); }
		}
	
		property bool RotateY
		{
			bool get() { return m_IfsAnimator->RotateY(); }
			void set(bool rotate) { m_IfsAnimator->RotateY(rotate); }
		}
	
		property bool RotateO
		{
			bool get() { return m_IfsAnimator->RotateO(); }
			void set(bool rotate) { m_IfsAnimator->RotateO(rotate); }
		}

		property float XRotationRate
		{
			float get() { return m_IfsAnimator->XRotationRate(); }
			void set(float rate) { m_IfsAnimator->XRotationRate(rate); }
		}

		property float YRotationRate
		{
			float get() { return m_IfsAnimator->YRotationRate(); }
			void set(float rate) { m_IfsAnimator->YRotationRate(rate); }
		}

		property float ORotationRate
		{
			float get() { return m_IfsAnimator->ORotationRate(); }
			void set(float rate) { m_IfsAnimator->ORotationRate(rate); }
		}

		property float Colorful
		{
			float get() { return m_IfsAnimator->CurrentPreset()->Colorful(); }
			void set(float colorful) { m_IfsAnimator->CurrentPreset()->Colorful(colorful); }
		}

		property float Exposure
		{
			float get() { return m_IfsAnimator->CurrentPreset()->Exposure(); }
			void set(float exposure) { m_IfsAnimator->CurrentPreset()->Exposure(exposure); }
		}

		property float TexScale
		{
			float get() { return m_IfsAnimator->CurrentPreset()->TexScale(); }
			void set(float texScale) { m_IfsAnimator->CurrentPreset()->TexScale(texScale); }
		}

		property float ScreenInitScale
		{
			float get() { return m_IfsAnimator->CurrentPreset()->ScreenInitScale(); }
			void set(float initScale) { m_IfsAnimator->CurrentPreset()->ScreenInitScale(initScale); }
		}

		property int FirstLevel
		{
			int get() { return m_IfsAnimator->CurrentPreset()->FirstLevel(); }
			void set(int firstLevel) { m_IfsAnimator->CurrentPreset()->FirstLevel(firstLevel); }
		}

		property int LastLevel
		{
			int get() { return m_IfsAnimator->CurrentPreset()->LastLevel(); }
			void set(int lastLevel) { m_IfsAnimator->CurrentPreset()->LastLevel(lastLevel); }
		}

		property int Iterations
		{
			int get() { return m_IfsAnimator->CurrentPreset()->Iterations(); }
			void set(int iterations) { m_IfsAnimator->CurrentPreset()->Iterations(iterations); }
		}

	private:
		IfsAnimator* m_IfsAnimator;
		//xForm* m_TestxForm;
	};
}
